//路由层

//导入路由控制器层
let routesController = require('../routesController/routesController')

module.exports = (app) => {
    app.use(routesController.validCode); //通过白名单验证验证码
    app.use(routesController.validLogin) //通过token验证是否登录
    app.get('/', (req, res) => { //没用的
        res.send('访问成功')
    });
    app.post('/userInfo', routesController.userInfo)
    app.post('/code', routesController.getCode)
    app.post('/register', routesController.register)
    app.post('/login', routesController.login)
    app.post('/addType', routesController.addType)
    app.get('/findType', routesController.findTypeData)
    app.post('/editType', routesController.editType)
    app.post('/disableType', routesController.disableType)
    app.post('/enableType', routesController.enableType)
    app.post('/removeType', routesController.removeData)
    app.get('/count', routesController.count)
}